from com.ad.sword.dao.models import MonitorTask,HttpTask
from mongoengine.errors import DoesNotExist





def list(frequency):
    tasks = MonitorTask.objects(status='E')
    res = []
    print tasks
    if tasks:
        _convert(tasks,res)
    return res



def _convert(tasks,res):
    for task in tasks:
        t={}
        for k in task:
            t[k]=str(task[k])
        res.append(t)



